package com.blueheart.Test.lang;

public class StringTest {

    public static void main(String[] args) {
        String str1 = "abc";//注意这种字面量声明的区别，文末会详细介绍
        String str2 = new String("abc");
        String str3 = new String(new char[]{'a','b','c'});
        System.out.println(str1.equals(str2) && str2.equals(str3));
        System.out.println(str1.hashCode() == str2.hashCode() && str2.hashCode() == str3.hashCode());
        System.out.println(str1.length() == 3);
        //System.out.println(str1.charAt(-1));

        System.out.println(str1.compareTo(str2));

        System.out.println(('a' - 'a'));

    }
}
